# Draw the generated maps in top-down view
import random

import matplotlib.pyplot as plt
from metadrive import MetaDriveEnv
from metadrive.utils.draw_top_down_map import draw_top_down_map

env = MetaDriveEnv(config=dict(
    num_scenarios=100,
    map=7,
    start_seed=random.randint(0, 1000)
))

fig, axes = plt.subplots(4, 4, figsize=(10, 10), dpi=100)
for i in range(4):
    for j in range(4):
        env.reset()
        m = draw_top_down_map(env.current_map)
        ax = axes[i, j]
        ax.imshow(m, cmap="bone")
        ax.set_xticks([])
        ax.set_yticks([])

fig.suptitle("Birdeye View of generated maps.")
plt.show()

env.close()

